Chris Pollett > Old Classses >
CS174

( Print View )

Student Corner:
  [Grades Sec1]
  [Submit Sec1]
  [Class Sign Up Sec1]
  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [Class Protocols]
  [HW/Quiz Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Quizzes]

Practice Exams:
  [Midterm]  [Final]

                           












HW#5 --- last modified February 07 2019 04:37:56..

Solution set.

Due date: Dec 4

Files to be submitted:
  Hw5.zip

Purpose:To experiment with different mechanisms for scaling websites.

Related Course Outcomes:

The main course outcomes covered by this assignment are:

LO5 -- Develop and deploy web applications that involve components, web services, and databases.

Specification:

For this homework I would like you to test how fast Apache can serve various kinds of pages using Apache Benchmark. To start I would like you to make a 20KB HTML 5 file, test.html. You should have this in the ZIP file you submit. This file should validate as HTML 5, but is otherwise unconstrained. I want you to experiment making 100, 500, 1000, 2000, 5000, 10000 requests on this file. For each number of requests I want you to test with concurrency set to values 1, 10, 50, 100. Next I want to make a file test.php. This file is the same as test.html except somewhere in it you have the line <? echo "hello world" ?>. I want you to run the same tests you just performed on test.html on this file test.php. Next make file sql_test.php and create_sql_test.php. Running create_sql_test.php will make a database SQL_TEST with two tables USER(ID CHAR(9), NAME VARCHAR(20)) and USER_POST(USER_ID CHAR(9), TWEETS VAR_CHAR(140), AT_WHAT_TIME INTEGER). USER_ID is a foreign key to the ID column in the USER table, the AT_WHAT_TIME column is the number of seconds since the start of the current epoch. After table set-up, create_sql_test.php populates the USER table with three users (1, bob), (2, sally), (3, frank) and populates USER_POST with 30 tweets from each user. The script sql_test.php picks a user name (not ID) at random three times. Each time it looks up that name in USER and does a join to find the first 15 most recent tweets of that user. It prints the name and tweets to the output. Use Apache bench to run the same tests on sql_test.php as you did earlier. As a last test, I was you to make a file memcache_sql_test.php. This file is like sql_test.php except that before doing its database query it checks if there is a user object (containing name and tweets) already stored in memcache. If there is, it outputs that object; otherwise, it does the database query/queries and stored the result as object into memcache before outputting it. Do the same tests as earlier on memcache_sql_test.php

For the last part of the homework, I want you to write up your experiments as a mobile HTML 5 app that uses the viewport meta directives, jQuery mobile, and canvas. The grader will point their mobile browser at a file index.php to see your write up. You should have a config folder with a readme.txt indicating group members and a file config.php with any local configurations that might need to be changed. Try to make your write up look as cool as possible.

Point Breakdown

test.html as described (1pt). Experiments on it described on index.php site. (1pt)2pts
test.php as described (1pt). Experiments on it described on index.php site. (1pt)2pts
sql_test.php and create_sql_test.php as described (1pt). Experiments on it described on index.php site. (1pt)2pts
memcache_sql_test.php as described (1pt). Experiments on it described on index.php site. (1pt)2pts
Experiment site makes constructive use of viewport meta tag (1/2pt), jQuery mobile (1/2pt), and canvas (1/2pt). readme.txt and config folder as described (1/2pt) 2pts
Total10pts